package com.itqf.service.impl;

import com.itqf.entity.Product;
import com.itqf.mapper.ProductMapper;
import com.itqf.service.ProductService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/10/12
 * @Time: 下午3:35
 */
@Service("productServiceImpl")
public class ProductServiceImpl  implements ProductService {

    private Log log = LogFactory.getLog(ProductServiceImpl.class);


    //dao
    @Resource
    private ProductMapper productMapper;//从spring容器


    @Override
    public int delete(int id) {
        log.debug("删除操作"+id);
        return productMapper.delete(id);
    }
    @Override
    public List<Product> findAll() {
        log.debug("全查操作");
        return productMapper.findAll();
    }

    @Override
    public Product findById(int id) {
        log.debug("findById操作"+id);
        return productMapper.findById(id);
    }

    @Override
    public int update(Product product) {
        return productMapper.update(product);
    }

    @Override
    public int add(Product product) {
        return productMapper.add(product);
    }
}
